package ldh.serialize.type;

import java.io.IOException;

import ldh.serialize.BinarySerialized;
import ldh.serialize.io.ByteBuf;
import ldh.serialize.util.SerializedUtil;

public class IntegerSerialized implements BinarySerialized<Integer> {

	@Override
	public void write(ByteBuf out, Integer num) throws IOException {
		SerializedUtil.writeInteger(out, num);
	}

	@Override
	public Integer read(ByteBuf in) throws IOException {
		return SerializedUtil.readInteger(in);
	}

	@Override
	public Class<Integer> getClassType() {
		return Integer.class;
	}
}
